import ajax from '@/utils/ajax'
import dialog from '@/utils/dialog'
import util from '@/utils/index'
export default function (query) {
  const url = query.id ? '/a/address/updateAddress' : '/a/address/addAddress'
  return ajax({
    url: `${url}?${util.objectToString(query)}`,
    data: query
  }).catch(msg => dialog.showToast(msg || '请求失败'))
}
